project(LYADTest)
cmake_minimum_required(VERSION 2.8)

SET(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} "--std=c++11")

set(OpenCV_DIR /home/nvidia/opencv330_gpu/share/OpenCV)
find_package(OpenCV)
find_package(Boost REQUIRED
    system
    filesystem
    thread)


include_directories(src /usr/local/cuda/include src/hik_include ${OpenCV_INCLUDE_DIRS})
#link_directories(src/hik_lib)
set(Hik_LIBS
${PROJECT_SOURCE_DIR}/src/hik_lib/libGCBase_gcc48_v3_0.so
${PROJECT_SOURCE_DIR}/src/hik_lib/libGenApi_gcc48_v3_0.so
${PROJECT_SOURCE_DIR}/src/hik_lib/libLog_gcc48_v3_0.so
${PROJECT_SOURCE_DIR}/src/hik_lib/libMVGigEVisionSDK.so
${PROJECT_SOURCE_DIR}/src/hik_lib/libMathParser_gcc48_v3_0.so
${PROJECT_SOURCE_DIR}/src/hik_lib/libMvCameraControl.so
${PROJECT_SOURCE_DIR}/src/hik_lib/libMvUsb3vTL.so
${PROJECT_SOURCE_DIR}/src/hik_lib/libNodeMapData_gcc48_v3_0.so
${PROJECT_SOURCE_DIR}/src/hik_lib/libXmlParser_gcc48_v3_0.so
${PROJECT_SOURCE_DIR}/src/hik_lib/liblog4cpp_gcc48_v3_0.so
)
#add_subdirectory(src/serial)
#add_subdirectory(src/tool)
#add_subdirectory(src/para)

include(src/robot_hw/CMakeLists.txt)
#include(src/tools/CMakeLists)

add_library(common src/common.cpp)
target_link_libraries(common ${OpenCV_LIBS} ${Boost_LIBRARIES})

add_library(transform src/tf/transform.cpp)

add_library(ArmorDetector src/armor/ArmorDetector.cpp)
target_link_libraries(ArmorDetector ${OpenCV_LIBS})

add_library(ArmorDetectorThread src/armor/ArmorDetectorThread.cpp)
target_link_libraries(ArmorDetectorThread ${OpenCV_LIBS} ArmorDetector pthread)

add_library(MVCamera src/camera/MVCamera.cpp)
target_link_libraries(MVCamera ${OpenCV_LIBS} ${Hik_LIBS})

add_executable(ArmorDetectorTest src/test/ArmorDetectorTest.cpp)
target_link_libraries(ArmorDetectorTest ${OpenCV_LIBS} ArmorDetector ArmorDetectorThread pthread ${Boost_LIBRARIES} MVCamera common)

add_executable(MVTest src/test/MVTest.cpp)
target_link_libraries(MVTest ${OpenCV_LIBS} MVCamera)

#add_executable(ColorDiff src/test/ColorDiff.cpp)
#target_link_libraries(ColorDiff ${OpenCV_LIBS} ArmorDetector MVCamera pthread common ${Boost_LIBRARIES})

add_executable(ParallelTest src/test/ParallelTest.cpp)
target_link_libraries(ParallelTest ${OpenCV_LIBS} MVCamera ArmorDetectorThread)

#add_executable(GimbalOperation src/test/GimbalOperation.cpp)
#target_link_libraries(GimbalOperation ${OpenCV_LIBS} RobotControl)

add_executable(ArmorAiming src/test/ArmorAiming.cpp)
target_link_libraries(ArmorAiming ${OpenCV_LIBS} ArmorDetector RobotControl MVCamera transform)

